/* This genie creates a new style tag automatically by examining a block of selected text in a document. If the text is in a style which does not match an existing tag, a new tag is created and the text is optionally set to that tag. Tags are named with a simplified description of the typeface; you can alter any of these names to anything you wish (using the "Style Tags Modify" menu item). If you modify the tag, its typeface name might no longer suit it. */
/* Method: load in typographic data from selected text. If an existing style is used, see if it is modified (further data after the style name). Ignore any data for text after the first letter. If no existing style is used, assemble the data and compare with all existing styles to see if there is a match. If not, suggest a name for a new style, create it and apply it to the block. */
/* Written by Don Cox 1993. Not Public Domain. All rights reserved. */
trace n
if ~show(l, "gdarexxsupport.library") then
if ~(exists("libs:gdarexxsupport.library") & addlib("gdarexxsupport.library", 0, -30)) then
exit_msg("Please install the gdarexxsupport.library in your libs: directory before running this Genie")
address command
text = ppm_GetBlockText( 1)
if text = '' then exit_msg("No text selected")
apply = ppm_Inform(2,"Apply style to whole of selected text?","No","Yes")
call ppm_ShowStatus(" Analysing text...")
call clearcodes
position = 1
change = 0
position = parsecodes(position) /* parse a block of codes in text */
if position = 0 then exit_msg("No style information found")